//
//  EventTrackStatistic.m
//  runtimeDemo
//
//  Created by admin on 2018/3/1.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "EventTrackStatistic.h"
#import "Aspects.h"
#import "AspectTrackViewController.h"

@implementation EventTrackStatistic

+ (void)setupAnalytics {
    [AspectTrackViewController aspect_hookSelector:@selector(buttonClicked) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo) {
        NSLog(@"aspectinfo %@", aspectInfo);
        NSLog(@"the second method click");
    } error:NULL];
    
}

- (void)trackEventWithClass:(Class)kClass selector:(SEL)selector event:(NSString *)event {
    [kClass aspect_hookSelector:selector withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo) {
        
    } error:NULL];
}

- (void)trachEventWithClass:(Class)kClass selector:(SEL)selector eventHandle:(void (^)(id<AspectInfo>))eventHandle {
    [kClass aspect_hookSelector:selector withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> info) {
        
    } error:NULL];
}

- (void)setupAnalyticsTwice {
    [self trachEventWithClass:[AspectTrackViewController class] selector:@selector(buttonClicked) eventHandle:^(id<AspectInfo> aspectInfo) {
        
    }];
}



@end
